/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package compevol;

/**
 *
 * @author vitor
 */
public class Funcao2 implements Fitness {

    //Modelo de esfera:
    public double avalia(Individuo ind) {
        double[] valor = ind.valores();
        double sum = 0;
        int n = valor.length;
        for(int i= 0; i< n; i++){
            sum+= Math.pow( valor[i],2);
        }
        return sum;

    }

    @Override
    public String toString() {
        return "F2";
    }
    
}
